import './Mars3dSetUp.scss'
import { Button } from 'antd'
import PropTypes from 'prop-types'

import { optionsList } from '../../Assets/Params'
import { UseConfigSection } from '../../Template/FormTemplate'

const Mars3dFitA05 = ({ data, Off, ModalEvent }) => {
    Mars3dFitA05.propTypes = { data: PropTypes.object, Off: PropTypes.func, ModalEvent: PropTypes.object }

    const list = [
        { key: 101, uuid: 'FitA05', label: '导航球', type: 'RadioTemp', name: 'compass', options: optionsList.isShow },
        { key: 102, uuid: 'FitA05', label: '视角复位', type: 'RadioTemp', name: 'homeButton', options: optionsList.isShow },
        { key: 103, uuid: 'FitA05', label: '地图缩放', type: 'RadioTemp', name: 'zoom', options: optionsList.isShow },
        { key: 104, uuid: 'FitA05', label: '全屏切换', type: 'RadioTemp', name: 'fullscreenButton', options: optionsList.isShow },
        { key: 105, uuid: 'FitA05', label: 'POI搜索', type: 'RadioTemp', name: 'geocoder', options: optionsList.isShow },
        { key: 106, uuid: 'FitA05', label: '状态栏', type: 'RadioTemp', name: 'locationBar', options: optionsList.isShow },
        { key: 107, uuid: 'FitA05', label: '比例尺', type: 'RadioTemp', name: 'distanceLegend', options: optionsList.isShow },
    ]

    const onSubmit = () => {
        ModalEvent.emit({ type: 'scene', data })
        Off()
    }

    return (
        <div className='Mars3dSetUp Mars3dFitA05'>
            <div className='FormList'>
                {UseConfigSection(data, list)}
            </div>
            <div className='Button'>
                <Button type='primary' danger onClick={Off}>取消</Button>
                <Button type='primary' onClick={onSubmit}>保存</Button>
            </div>
        </div>
    );
};

export default Mars3dFitA05;